import config from "@/config"
import http from "@/utils/request"

export default {
	add: {
		url: `${config.API_URL}/task/createTask`,
		name: "添加任务",
		post: async function(data){
			return await http.post(this.url, data);
		}
	},
	edit: {
		url: `${config.API_URL}/task/updateTask`,
		name: "修改任务",
		post: async function(data){
			return await http.post(this.url, data);
		}
	},
	detail: {
		url: `${config.API_URL}/task/getTaskDetail`,
		name: "单任务基本信息",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	list: {
		url: `${config.API_URL}/task/getTaskList`,
		name: "任务列表",
		post: async function(params){
			return await http.post(this.url, params);
		}
	},
	getUserTable: {
		url: `${config.API_URL}/task/tableNotGroupByUser`,
		name: "任务列表",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	projectTasklist: {
		url: `${config.API_URL}/task/getProjectTask`,
		name: "项目任务列表",
		get: async function(params){
			return await http.get(this.url,params);
		}
	},
	delete: {
		url: `${config.API_URL}/task/deleteTask`,
		name: "删除任务",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	addFile: {
		url: `${config.API_URL}/task/saveFile`,
		name: "上传附件",
		post: async function(params){
			return await http.post(this.url, params);
		}
	},
	taskSort: {
		url: `${config.API_URL}/task/taskSort`,
		name: "拖拽",
		post: async function(params){
			return await http.post(this.url, params);
		}
	},
	examTask: {
		url: `${config.API_URL}/task/examTask`,
		name: "领导审批",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	rejectTask: {
		url: `${config.API_URL}/task/rejectTask`,
		name: "领导驳回",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	createTaskResponsible: {
		url: `${config.API_URL}/task/createTaskResponsible`,
		name: "创建负责人",
		post: async function(params){
			return await http.post(this.url, params);
		}
	},
	downloadWeek: {
		url: `${config.API_URL}/task/downloadWeek`,
		name: "导出周报",
		get: async function(){
			return await http.get(this.url);
		},
		responseType: 'blob'
	},
	pointTask: {
		url: `${config.API_URL}/task/point`,
		name: "是否有新进展",
		get: async function(){
			return await http.get(this.url);
		}
	},
	waitingTask: {
		url: `${config.API_URL}/task/waiting`,
		name: "设置待验收",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	urgeTask: {
		url: `${config.API_URL}/task/urge`,
		name: "催办",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	getResponsibleList: {
		url: `${config.API_URL}/jjUser/getResponsibleList`,
		name: "返回登陆人所在部门的非领导非管理员人员列表",
		get: async function(){
			return await http.get(this.url);
		}
	},
	getResponsibleListMobile: {
		// url: `${config.API_URL}/jjUser/getResponsibleList`,
		url: `${config.API_URL}/jjUser/getResponsibleListMobile`,
		name: "返回登陆人所在部门的非领导非管理员人员列表",
		get: async function(params){
			return await http.get(this.url,params);
		}
	},

}
